package com.sfdk.net.php
{
import com.sfdk.net.php.messages.RemotingMessage;

import flash.events.EventDispatcher;
import flash.net.Responder;

public class BaseRemotingService extends EventDispatcher
	{
		private var _category:String;
		
		public function BaseRemotingService(category : String):void
		{
			_category = category;
		}
	
		public function call(method : String, callback : Responder, ... args : Array) : void
		{
			var message:RemotingMessage = new RemotingMessage();
			message.operation = method;
			message.body = args;
			message.destination = _category;
			
			RemotingService.instance.send(callback, message);
		}
	}
}
